package screen;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;

import book.Book;

import keyboard.KeyCode;

public class Page extends Canvas {

	private SyntaxicUnitChain syntaxicUnitChain;
	private Font font = null;
	private String currentPhrase = null;
	
	protected void paint(Graphics g) {
		
		if (font == null) {
			font = g.getFont();
		}
		
		if (syntaxicUnitChain != null) {
			// TODO Find ,;: !?. and split if necesary
			int hPos = 0;
			if (syntaxicUnitChain != null) {
				hPos = syntaxicUnitChain.getCurrent().getSeparatorHPos() + 1;
			}
			// TODO
//			SyntaxicUnit syntaxicUnit = new SyntaxicUnit();
			
			if (syntaxicUnitChain == null) {
				// TODO
			}
			// TODO
		}
		
		// TODO Auto-generated method stub
	}


	public void keyPressed(int keyCode) {

		if (keyCode == KeyCode.BAS) {
//			Book.readNext();
		}
	}

	public void nextPhrase(String phrase) throws Exception {
		if (font == null) {			
			throw new Exception("Set as current display first.");
		}
		currentPhrase = phrase;
	}
}
